home *** CD-ROM | disk | FTP | other *** search
/ BUG 1 / BUGCD1996_0708.ISO / pc / util / minilin / minilin.exe / VAR / ADM / SETUP / SETUP_FO.{_4 < prev    next >
Text File  |  1994-05-24  |  5KB  |  149 lines

  1. #!/bin/sh
  2. load_font() {
  3.  if [ -x $T_PX/usr/bin/setfont ]; then
  4.   SETFONT=$T_PX/usr/bin/setfont
  5.  elif [ -x /var/adm/mount/usr/bin/setfont ]; then
  6.   SETFONT=/var/adm/mount/usr/bin/setfont
  7.  fi
  8.  if [ -r $T_PX/usr/lib/kbd/consolefonts/$1 ]; then
  9.   $SETFONT $T_PX/usr/lib/kbd/consolefonts/$1 1> /dev/null 2> /dev/null
  10.  elif [ -r /var/adm/mount/usr/lib/kbd/consolefonts/$1 ]; then
  11.   $SETFONT /var/adm/mount/usr/lib/kbd/consolefonts/$1 1> /dev/null 2> /dev/null
  12.  fi
  13. }
  14. if [ -r /tmp/SeTT_PX ]; then
  15.  T_PX="`cat /tmp/SeTT_PX`"
  16. elif [ ! "$1" = "" ]; then
  17.  T_PX=$1
  18. else
  19.  T_PX=/
  20. fi
  21. if [ "$COLOR" = "on" -o -r /tmp/SeTcolor ]; then # use color menus
  22.  dialog --title "SCREEN FONT CONFIGURATION" --yesno "Would you like to try \
  23. out some custom screen fonts?" 7 35
  24.  if [ $? = 1 ]; then
  25.   exit
  26.  fi
  27.  while [ 0 ]; do
  28.   dialog --title "SELECT A SCREEN FONT" --menu "Select one of the following \
  29. custom fonts. If you decide you like it, you can make it your new default \
  30. screen font. You'll be able to try as many of these as you like." 21 40 10 \
  31. "8x14alt" "" "8x14thin" "" "8x15" "" "8x16alt" "" "8x8thin" "" \
  32. "Cyr_a8x14" "" "Cyr_a8x16" "" "Cyr_a8x8" "" "aply16.psf" "" "b.fnt" "" \
  33. "c.fnt" "" "def2_8x16" "" "default8x16" "" "default8x9" "" "gr.f14" "" \
  34. "gr.f16 " "" "iso01.f08" "" "iso01.f14" "" "iso01.f16" ""  "iso02.f08" "" \
  35. "iso02.f14" "" "iso02.f16" "" "iso03.f08" "" "iso03.f14" "" "iso03.f16" "" \
  36. "iso04.f08" "" "iso04.f14" "" "iso04.f16" "" "iso05.f08" "" "iso05.f14" "" \
  37. "iso05.f16" "" "iso06.f08" "" "iso06.f14" "" "iso06.f16" "" "iso07.f08" "" \
  38. "iso07.f14" "" "iso07.f16" "" "iso08.f08" "" "iso08.f14" "" "iso08.f16" "" \
  39. "iso09.f08" "" "iso09.f14" "" "iso09.f16" "" "iso10.f08" "" "iso10.f14" "" \
  40. "iso10.f16" "" "koi8-14.psf" "" "lat1-08.psf" "" "lat1-10.psf" "" \
  41. "lat1-12.psf" "" "lat1-14.psf" "" "lat1-16.psf" "" "lat2-08.psf" "" \
  42. "lat2-10.psf" "" "lat2-12.psf" "" "lat2-14.psf" "" \
  43. "lat2-16.psf" "" "m.fnt" "" "ml.fnt" "" "mod_d.fnt" "" "mod_s.fnt" "" \
  44. "mr.fnt" "" "mu.fnt" "" "r.fnt" "" "rl.fnt" "" "s.fnt" "" "sc.fnt" "" \
  45. "scrawl_s.fnt" "" "scrawl_w.fnt" "" "sd.fnt" "" "t.fnt" "" 2> /tmp/font
  46.  
  47.   if [ $? = 1 -o $? = 255 ]; then
  48.    rm -f /tmp/font
  49.    load_font default8x16
  50.    exit
  51.   fi
  52.   FONT="`cat /tmp/font`"
  53.   rm -f /tmp/font
  54.   load_font $FONT
  55.   dialog --title "SET AS DEFAULT FONT" --yesno "Well, what do you think? \
  56. If you'd like to make this your default font, select YES. You can change \
  57. the default font any time by typing 'fontconfig' or by editing \
  58. /etc/rc.d/rc.font. If you don't \
  59. like this font, select NO, and you'll be returned to the font selection \
  60. menu. If you decide you want to stick with the default font, hit ESC or \
  61. CANCEL once you get to that menu." 13 60
  62.   if [ $? = 0 ]; then
  63.    cat << EOF > $T_PX/etc/rc.d/rc.font
  64. #!/bin/sh
  65. #
  66. # This selects your default screen font from among the ones in
  67. # /usr/lib/kbd/consolefonts.
  68. #
  69. setfont /usr/lib/kbd/consolefonts/$FONT
  70. EOF
  71.    chmod 755 $T_PX/etc/rc.d/rc.font
  72.    exit
  73.   fi
  74.  done
  75. else # no color!
  76.  echo
  77.  echo -n "Would you like to try out some custom screen fonts ([y]es, [n]o)? "
  78.  read YESNO;
  79.  if [ "$YESNO" = "n" ]; then
  80.   exit
  81.  fi
  82.  while [ 0 ]; do
  83.   cat << EOF
  84. SELECT A SCREEN FONT
  85.  
  86. Select one of the following custom fonts. If you decide you like it, you can
  87. make it your new default screen font. You'll be able to try as many of these
  88. as you like.
  89.  
  90. 8x14alt     8x14thin    8x15        8x16alt      8x8thin      Cyr_a8x14
  91. Cyr_a8x16   Cyr_a8x8    b.fnt       c.fnt        def2_8x16    default8x16
  92. koi8-14.psf lat1-08.psf lat1-10.psf lat1-12.psf  lat1-14.psf  lat1-16.psf
  93. lat2-08.psf lat2-10.psf lat2-12.psf lat2-14.psf  lat2-16.psf  m.fnt
  94. ml.fnt      mod_d.fnt   mod_s.fnt   mr.fnt       mu.fnt       r.fnt
  95. rl.fnt      s.fnt       sc.fnt      scrawl_s.fnt scrawl_w.fnt sd.fnt
  96. t.fnt       aply16.psf  default8x9  gr.f14       gr.f16       iso01.f08
  97. iso01.f14   iso01.f16   iso02.f08   iso02.f14    iso02.f16    iso03.f08
  98. iso03.f14   iso03.f16   iso04.f08   iso04.f14    iso04.f16    iso05.f08
  99. iso05.f14   iso05.f16   iso06.f08   iso06.f14    iso06.f16    iso07.f08
  100. iso07.f14   iso07.f16   iso08.f08   iso08.f14    iso08.f16    iso09.f08
  101. iso09.f14   iso09.f16   iso10.f08   iso10.f14    iso10.f16 
  102.  
  103. EOF
  104.   echo -n "Which font would you like (or ENTER to quit)? "
  105.   read FONT;
  106.   if [ "$FONT" = "" ]; then
  107.    load_font default8x16
  108.    echo
  109.    exit
  110.   fi
  111.   if [ ! -r $T_PX/usr/lib/kbd/consolefonts/$FONT -a ! -r \
  112.          /var/adm/mount/usr/lib/kbd/consolefonts/$FONT ]; then
  113.    cat << EOF
  114.  
  115. Sorry, I couldn't find that font. Try again.
  116.  
  117. EOF
  118.   fi
  119.   load_font $FONT
  120.   cat << EOF
  121.  
  122. SET AS DEFAULT FONT
  123.  
  124. Well, what do you think? If you'd like to make this your default font, select
  125. YES. You can change the default font any time by typing 'fontconfig' or by 
  126. editing /etc/rc.d/rc.font. If you don't like this font, select NO, and you'll
  127. be able to select a different one. If you decide you want to stick with the
  128. default font, hit RETURN once you return to the font selection menu.
  129.  
  130. EOF
  131.   echo -n "Would you like to have this font loaded by default ([y]es, [n]o)? "
  132.   read DEF
  133.   if [ "$DEF" = "YES" -o "$DEF" = "y" ]; then
  134.    cat << EOF > $T_PX/etc/rc.d/rc.font
  135. #!/bin/sh
  136. #
  137. # This selects your default screen font from among the ones in
  138. # /usr/lib/kbd/consolefonts.
  139. #
  140. setfont /usr/lib/kbd/consolefonts/$FONT
  141. EOF
  142.    chmod 755 $T_PX/etc/rc.d/rc.font
  143.    echo
  144.    exit
  145.   fi
  146.   echo
  147.  done
  148. fi
  149.